<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String resourceFlag = "";
if(basePath.contains("com")||basePath.contains("org")||basePath.contains("cn")){
	resourceFlag = "2";
}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
  <head>
    <base href="<%=basePath%>" />
    <title>用户登录</title>
    <script type="text/javascript">
		var path = "<%=basePath%>";
	</script>
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
	<meta http-equiv="description" content="This is my page" />
	<link type="text/css" rel="stylesheet" href="<%=basePath%>basic/css/login.css" />
	<script type="text/javascript" src="<%=basePath%>resources/jquery/jquery-1.7.2.min.js"></script>
	<script type="text/javascript">
	  	$(function() {
	  		$("#userID").focus();
	  		$("#userID").keydown(tabClick1);//解决浏览器兼容问题
	  		$("#password").keydown(tabClick2);
	  		$("#loginSys").keydown(tabClick3);
	  	});
		function doSubmit(){
			//用户名
			var userID =document.getElementById("userID").value;
		  	userID = encodeURIComponent(userID);
		  	//密码
		  	var password = document.getElementById("password").value;
		  	password = encodeURIComponent(password);
		  	//信息校验及提交
		  	if(userID =="") {
		    	document.getElementById("userID").focus();
		    	$("#logInfo").empty().append("用户名不能为空!");
		   		return;
		 	} else if(password =="") {
			    document.getElementById("password").focus();
			    $("#logInfo").empty().append("密码不能为空!");
			    return;
		  	} else {
		  		window.location = path + "basic/loginAction!login.do?userID="+userID+"&password="+password+"&date="+new Date();
		  	}
		}
		function tabClick1(event){
		//window.event.keyCode兼容IE event.which兼容Firefox
			if (event.keyCode == 13) {
				$("#password").focus();
			}
		}
		function tabClick2(event) {
			if (event.keyCode == 13)
				document.getElementById("loginSys").focus();
		}

		function tabClick3(event) {
			if (event.keyCode == 13)
				doSubmit();
		}
		function clearIns() {
			document.getElementById("userID").value = "";
			document.getElementById("password").value = "";
		}
	</script>
  </head>
  <body style="background:url(<%=basePath%>basic/images/login_bg_new<%=resourceFlag%>.jpg) center center no-repeat #49a7a4">
<%--   <body style="background:#49a7a4; overflow:hidden;" > --%>
  	<!--背景图-->
 <%-- 	<div class="main_bg" id="main_bg"></div> --%>
  	<div class="main">
	    <div class="main_top">
	        <img src="<%=basePath%>basic/images/login_logo.png" width="85" height="80" id="img1"   alt=""/>
	        <img src="<%=basePath%>basic/images/logo_top2.png" width="455" height="135" id="img2"  alt=""/> 
<!-- 	        <img src="<%=basePath%>basic/images/login_logo2.png" width="270" height="40" id="img3"  alt=""/> -->
	    </div>
	    
	    <div class="content">
	    	<div class="login_top"></div>
	        <div class="login_top2"></div>
	        <div class="login_bottom"></div>
	        <div class="login_bottom2">
	            <div class="top"></div>
	            <a href="http://110.172.224.103:8080/beshs/index.jsp" class="btn" id="loginSys" name="loginSys"> <span class="login_word6"></span></a>
	            <a href="http://119.161.132.13:8080/bhtsys" class="btn" id="loginSys" name="loginSys" > <span class="login_word7"></span></a>
<!-- 	            <span class="waring">注：建议使用IE8或以上版本IE浏览器</span> -->
	        </div>
	        <div id="footer" style="color: black;font-weight: bold;"><p><!-- 版权所有 © 2014 迅扬节能 保留所有权利 --></p></div>
	    </div>
	</div>
    <script type="text/javascript">
    	window.onload=AutoSize;
		window.onresize=AutoSize;
		function AutoSize() {
			var Width_Page = document.documentElement.clientWidth||window.document.body.clientWidth;
		  	var rigth_main_width = Width_Page;
			if(960<rigth_main_width){		 
// 				 document.getElementById("main_bg").style.width =rigth_main_width+"px";
// 			}else{rigth_main_width = 960;
//  				document.getElementById("main_bg").style.width =rigth_main_width+"px";
			}
		}
    </script>
  </body>
</html>
